package com.example.mobile2030606155byl0326;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView textView;
    private EditText editTextTextPersonName0;
    private EditText editTextTextPersonName1;
    private EditText editTextTextPersonName2;
    private EditText editTextTextPersonName3;
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textView = (TextView) findViewById(R.id.textView);
        editTextTextPersonName0 = (EditText) findViewById(R.id.editTextTextPersonName0);
        editTextTextPersonName1 = (EditText) findViewById(R.id.editTextTextPersonName1);
        editTextTextPersonName2 = (EditText) findViewById(R.id.editTextTextPersonName2);
        editTextTextPersonName3 = (EditText) findViewById(R.id.editTextTextPersonName3);
        button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(editTextTextPersonName2.getText().toString().equals(editTextTextPersonName3.getText().toString())) {
                    Log.i("密码修改成功","允许修改");
                    Toast.makeText(MainActivity.this, "密码已经修改", Toast.LENGTH_SHORT).show();
                }else{
                    Log.d("密码不一致","无法修改");
                    Toast.makeText(MainActivity.this, "密码不一致", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}